#include "tmsmapbutton.h"

void TmsButton::Draw(QPainter & painter, int btn_size, QPoint position,const QPixmap & pix)
{
    QRect rect(position.x(), position.y(), btn_size, btn_size);

    painter.drawPixmap(rect, pix);

    m_btn_rect = rect;
}

bool TmsButton::check_hover(QPoint pos)
{
    if (m_btn_rect.contains(pos))
    {
        return true;
    }
    else
    {
        return false;
    }
}

void TmsButton::btn_clicked()
{
    emit clicked();
}